
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content">
    <button shiro:hasPermission="file:sign:qscd" id="btn-success" class="btn btn-success pull-right" style="margin-left: 20px;" th:onclick="|yes(${fileSheet.id})|">签收</button>
    <button shiro:hasPermission="file:sign:qscd" id="btn-reject" class="btn btn-danger pull-right" style="margin-left: 20px;" th:onclick="|reject(${fileSheet.id})|">拒收</button>
    <div class="row" style="margin-top: 64px">
        <div class="col-xs-10 col-xs-offset-1">
            <div id="print">
                <table id="t1" class="t1">
                    <thead style="display: table-header-group">

                    <tr>
                        <td colspan="14">
                            <img th:src="@{/img/logo3.jpg}" width="64px" height="40px" style="margin-top: -30px">
                            <div style="display: inline-block;margin-top: 5px;margin-left: 20px">
                                <span style="letter-spacing: 24px;display: block;line-height: 20px">&nbsp;辽宁忠旺机械设备制造有限公司</span>
                                <span style="display: block;font-size: 12px;line-height: 20px">Liaoning Zhongwang Machinery Equipment Manufacturing Co., Ltd</span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="14" style="font-size: 16px;letter-spacing: 4px;">
                            存档清单
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="width: 8%;">项目编号</td>
                        <td style="width: 10%;">
                            [[${fileSheet.proCode}]]
                        </td>
                        <td style="width: 8%">项目名称</td>
                        <td colspan="3" style="width: 30%">
                            [[${fileSheet.proName}]]
                        </td>
                        <td style="width: 8%">项目数量</td>
                        <td style="width: 6%">
                            [[${fileSheet.proNum}]]
                        </td>
                        <td style="width: 6%">类型</td>
                        <td style="width: 9%">
                            [[${fileSheet.special}]]
                        </td>
                        <td style="width: 6%">部分</td>
                        <td style="width: 9%">
                            [[${fileSheet.part}]]
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 4%">序号</td>
                        <td colspan="5">名称</td>
                        <td style="width: 14%">纸质版数量（页）</td>
                        <td colspan="2">电子版数量（件）</td>
                        <td colspan="4">备注</td>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="plan : ${filePlan}">
                        <td th:text="${planStat.count}">1</td>
                        <td colspan="5" style="text-align:left;" th:text="${plan.fileName}"></td>
                        <td th:text="${plan.pageNum}"></td>
                        <td colspan="2" th:text="${plan.picecNum}"></td>
                        <td colspan="4" th:text="${plan.remark}"></td>
                    </tr>
                    </tbody>
                </table>
                <div class="row" style="font-size: 14px;line-height: 200%;">
                    <div class="col-xs-3" style="padding-left: 0">提报人：[[${fileSheet.createNameOne}]]&nbsp;&nbsp;[[${#dates.format(fileSheet.createTime,'yyyy.MM.dd')}]]</div>
                    <div class="col-xs-3">联系电话：[[${fileSheet.postTel}]]</div>
                    <div class="col-xs-3">审核：<span th:each="p : ${process}" th:if="${pStat.count == 1}">[[${p.verifyName}]]&nbsp;&nbsp;[[${#dates.format(p.verifyTime,'yyyy.MM.dd')}]]</span></div>
                    <div class="col-xs-3">批准：<span th:each="p : ${process}" th:if="${pStat.count == 2}">[[${p.verifyName}]]&nbsp;&nbsp;[[${#dates.format(p.verifyTime,'yyyy.MM.dd')}]]</span></div>
                </div>
            </div>
        </div>
        <div class="col-xs-1">
            <table id="t2" class="t2">
                <thead style="display: table-header-group">
                <tr><td></td></tr>
                <tr><td></td></tr>
                <tr><td></td></tr>
                <tr><td></td></tr>
                </thead>
            </table>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    function yes(id) {
        js.modal.confirm("确认转到档案科吗？", function () {
            js.post({
                url: ctx + "file/signFor/y",
                data: {id: id},
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        location.href = ctx + 'file/signFor';
                    } else {
                        js.modal.warning(result.msg);
                    }
                }
            })
        })
    }

    function reject(id) {
        js.modal.prompt("请编辑驳回原因", function (reason) {
            if (reason == null) {
                return;
            }
            if(reason == ""){
                js.modal.confirm("请填写驳回原因！",function (){
                    return;
                })
                return;
            }
            js.post({
                url: ctx + "file/signFor/reject",
                data: {
                    id: id,
                    rejectReason: reason
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        location.href = ctx + "file/signFor"
                    } else {
                        js.modal.warning(result.msg);
                    }
                }
            })

        });
    }


    $(function () {
        $("#t1 tr").each(function (i,v) {
            $("#t2 tr").eq(i).find("td").first().height($(this).find("td:first").height());
        })

    });
</script>
</body>
</html>
